<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <style type="text/css">
            @import "resources/dojotoolkit/dojo/resources/dojo.css";
            @import "resources/dojotoolkit/dijit/themes/tundra/tundra.css";
            @import "resources/dojotoolkit/dojox/grid/resources/Grid.css";

        </style>
        <script type="text/javascript">
            djConfig =
                {
                isDebug: false,
                parseOnLoad: true
            };
        </script>
        <script type="text/javascript" src="resources/dojotoolkit/dojo/dojo.js">
        </script>
        <script type="text/javascript" src="resources/NanoSN/config.js">
        </script>
        <script type="text/javascript">
            dojo.require("nanosn.widgets.crud._Grid");
            dojo.require("dojox.data.JsonRestStore");
            dojo.require("dijit.dijit");

            function f()
            {
                item =
                    {
                    "id": 5,
                    "question": "Whats up"
                };
                /*
                store = new dojox.data.JsonRestStore({
                    target: "/NanoSNFramework-AdminTest/REST/Polls/"
                });
                 */

                grid = dijit.byId("grid");
                store = grid._store;
                
                /**
                 * Comment
                 */
                function sweet(item) {
                    console.log("sweeeeet");
                    console.log(item);
                    console.log(store.isItem(item));
                    //store.deleteItem(item);
                }
                
                store.fetchItemByIdentity({identity: 2, onItem: sweet})
                /*
                console.log("Before");
                console.log(store.newItem(item));
                store.setValue(item, "question", "value"); */
                //store.save();
                

                console.log("" + store.isItem(item, true));
            };
        </script>
    </head>
    <body class="tundra">
        <div id="hi">hello world!</div>
        <button onclick="dojo.byId('hi').innerHTML='wert'; f();">say what</button>
        <div id="grid" dojoType="nanosn.widgets.crud._Grid" url="'/NanoSNFramework-AdminTest/REST/Polls/'">aaaa</div>
    </body>
</html>
